#include <iostream>

using namespace std;

class Subject {
public:
    virtual void request() = 0;
};

class RealSubject : public Subject{

public:
    void request() {
        cout << "ReqlRequest::request()" << endl;
    }
};


class Proxy : public Subject {
private:
    Subject* m_subject;

public:
    Proxy(Subject* sub) {
        m_subject = sub;
    }

    void request() {
        cout << "before request()" << endl;
        m_subject->request();
        cout << "after request()" << endl;
    }
};


int main(int argc, char** argv) {
    Proxy* p = new Proxy(new RealSubject);
    p->request();
}
